window.onload = function () {
    initorders(1)
}

function initorders(pageNO) {
    axios.get("/order/custom/findByUser",{
        params:{pageNO}
    }).then(resp =>{
        var info = resp.data;
        if (info != ""){
            var str = ""
            info.records.forEach(n =>{
                str += `<tr>
<td>${n.id}</td><td>${n.money}</td><td>${n.status}</td><td>${n.date}</td><td><a href="/custom/info.html?orderId=${n.id}">查看明细</a></td>
</tr>`
            })
            $('userOrder').innerHTML  = str

            var cutStr=""
            for (let i = 1;i <= info.pages;i++){
                cutStr += `<a style="margin-left: 10px;" href="javascript:initorders(${i})">${i}</a>`
            }

            $('cutOrderDiv').innerHTML = cutStr
        }
    })
}